import axios from 'axios'

export function request (config) {
  const instance = axios.create({
    baseURL: 'http://139.155.35.246:9090/',
    // headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    timeout: 5000
  })
  instance.interceptors.request.use(config => {
    if (window.sessionStorage.getItem('token')) {
      config.headers.Authorization = 'Bearer ' + window.sessionStorage.getItem('token')
    }
    return config
  })
  return instance(config)
}
